package com.demo.juc.safe;

import java.io.Serializable;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.Hashtable;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.locks.ReentrantLock;

/**
 * HashMap --》ConcurrentHashMap
 *
 * 面试题：
 * 1、初始容量、负载因子:
 * default initial capacity * (16) and the default load factor (0.75).
 *   看帖子自己补充
 *
 *
 */
public class MapUnSafe extends ReentrantLock implements Serializable {
    public static void main(String[] args) {
        HashMap<String, Object> map = new HashMap<>();
        ConcurrentHashMap<Object, Object> concurrentHashMap = new ConcurrentHashMap<>();
        Hashtable hashtable = new Hashtable();
        map.put(null,null);
        map.containsValue("aa");
        hashtable.put("k1","11");
        hashtable.put("k1","22");
        System.out.println(hashtable.get("k1"));
        map.put("k1","zs");  //看源码



    }
}
